
package com.food.mall.dao;

import com.food.mall.entity.FoodMallOrderItem;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FoodMallOrderItemMapper {
    int deleteByPrimaryKey(Long orderItemId);

    int insert(FoodMallOrderItem record);

    int insertSelective(FoodMallOrderItem record);

    FoodMallOrderItem selectByPrimaryKey(Long orderItemId);

    /**
     * 根据订单id获取订单项列表
     *
     * @param orderId
     * @return
     */
    List<FoodMallOrderItem> selectByOrderId(Long orderId);

    /**
     * 根据订单ids获取订单项列表
     *
     * @param orderIds
     * @return
     */
    List<FoodMallOrderItem> selectByOrderIds(@Param("orderIds") List<Long> orderIds);

    /**
     * 批量insert订单项数据
     *
     * @param orderItems
     * @return
     */
    int insertBatch(@Param("orderItems") List<FoodMallOrderItem> orderItems);

    int updateByPrimaryKeySelective(FoodMallOrderItem record);

    int updateByPrimaryKey(FoodMallOrderItem record);
}